{% extends 'base.html' %}
{% load payinfo_filters %}
{% block title %}
    付费咨询
{% endblock %}

{% block header %}
    <link rel="stylesheet" href="{% static '/css/index.css' %}">
    <link rel="stylesheet" href="{% static '/css/payinfo.css' %}">
{% endblock %}
{% block main %}
    <div class="main">
		<div class="wrapper">
			<div class="news-wrapper">
                <div class="advertise-pay">
                    <a href="#">
                        <img src="http://www.xfz.cn/static/build/images/web-venture-banner.png">
                    </a>
                </div>
                <ul class="list-pay">
                    <li>
                        <a href="#">
                        <div class="category-group" style="background-image:url('http://xfz.cn/static/build/images/web-bp-pc.png');"></div>
                        <div class="document-info">
                            <p class="document-title">如何写好一份商业计划书</p>
                            <p class="document-desc">一份好的商业计划书，是创业成功的开始！</p>
                            <p class="document-price">￥8.8</p>
                        </div>
                        </a>
                    </li>
                     {% for payinfo in payinfos %}
                        <li>
                            {% with payinfo|is_buyed:user as buyed %}
                             {% if buyed %}
                                 <a href="{% url 'payinfo:download' %}?payinfo_id={{ payinfo.pk }}">
                             {% else %}
                                 <a href="{% url 'payinfo:payinfo_order' %}?payinfo_id={{ payinfo.pk }}">
                             {% endif %}

                                <div class="category-group" style="background-image:url('http://xfz.cn/static/build/images/web-bp-pc.png');"></div>
                                <div class="document-info">
                                    <p class="document-title">{{ payinfo.title }}</p>
                                    <p class="document-desc">{{ payinfo.profile }}</p>
                                    <p class="document-price">
                                        {% if buyed %}
                                            点击下载
                                        {% else %}
                                            ￥{{ payinfo.price }}
                                        {% endif %}
                                    </p>
                                </div>
                            </a>
                        {% endwith %}
                        </li>
                    {% endfor %}
                </ul>
			</div>
			<div class="sidebar-wrapper">
				<div class="title-group">
					<span class="title">在线课堂</span>
					<a href="#" class="more">更多</a>
				</div>
				<div class="advertise-group">
					<a href="#"><img src="http://www.xfz.cn/static/build/images/side-gift-banner.png"></a>
				</div>
				<div class="platform-group">
					<div class="title-group">
						<span class="title">关注小饭桌</span>
					</div>
					<div class="focus-group">
						<ul class="left-group">
							<li class="zhihu"><a href="#" target="_blank">知乎小饭桌</a></li>
							<li class="weibo"><a href="#" target="_blank">微博小饭桌</a></li>
							<li class="toutiao"><a href="#" target="_blank">头条小饭桌</a></li>
						</ul>
						<div class="right-group"><p class="desc">dddddd扫码关注微信公众号6666</p></div>
					</div>
				</div>
				<div class="hot-news-group">
					<div class="title-group">
						<span class="title">热门推荐</span>
					</div>
					<ul class="hot-list-group">
						<li>
							<div class="left-group">
								<p class="title">
									<a href="#">王健林卖掉进军海外首个项目:17亿售伦敦ON...</a>
								</p>
								<p class="more">
									<span class="category">深度报道</span>
									<span class="pub-time">1-17 20:20:20</span>
								</p>
							</div>
							<div class="right-group">
								<a href="#"><img src="http://static-image.xfz.cn/1516169692_914.jpg-website.news.list" alt=""></a>
							</div>
						</li>
						<li>
							<div class="left-group">
								<p class="title">
									<a href="#">王健林卖掉进军海外首个项目:17亿售伦敦ON...</a>
								</p>
								<p class="more">
									<span class="category">深度报道</span>
									<span class="pub-time">1-17 20:20:20</span>
								</p>
							</div>
							<div class="right-group">
								<a href="#"><img src="http://static-image.xfz.cn/1516169692_914.jpg-website.news.list" alt=""></a>
							</div>
						</li>
					</ul>
				</div>
			</div>
		</div>
	</div>
{% endblock %}